<div ng-controller="goodsCtrl">
{if $_GPC['iseditor']}
<!--商品设置-->
<div class="app-goods-edit">
	<div class="arrow-left"></div>
	<div class="inner">
		<div class="panel panel-default">
			<div class="panel-body form-horizontal">
				<form class="form-horizontal">
					<div class="form-group">
						<label class="col-xs-3 control-label" ng-click="addItem();">选择商品</label>
						<div class="col-xs-9 form-control-static">
							<span class="goods-thumb" ng-show="activeItem.params.hasTestData == 0" ng-repeat="g in activeItem.params.goodsList">
								<span class="remove" ng-click="deleteItem($index)"><i class="fa fa-times"></i></span>
								<a href="#"><img ng-src="{{g.thumb}}" width="46" height="46"></a>
							</span>
							<a href="javascript:;" class="goods-select" id="goods-selecter" ng-click="showSearchGoodsList()"><i class="fa fa-plus-circle green"></i></a>
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-3 control-label">列表样式</label>
						<div class="col-xs-9">
							<label for="lgImg" class="radio-inline">
								<input type="radio" ng-model="activeModules[activeIndex].params.listStyle" value="1" name="goods-listStyle" id="lgImg"> 大图
							</label>
							<label for="smImg" class="radio-inline">
								<input type="radio" ng-model="activeModules[activeIndex].params.listStyle" value="2" name="goods-listStyle" id="smImg"/>小图
							</label>
							<label for="defaultList" class="radio-inline">
								<input type="radio" ng-model="activeModules[activeIndex].params.listStyle" value="3" name="goods-listStyle" id="defaultList" checked="checked">一大两小
							</label>
							<label for="detailList" class="radio-inline">
								<input type="radio" ng-model="activeModules[activeIndex].params.listStyle" value="4" name="goods-listStyle" id="detailList"/>详细列表
							</label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-3 control-label"></label>
						<div class="col-xs-9" ng-switch="activeItem.params.listStyle">
							<!--一大两小样式设置-->
							<div class="card" ng-switch-when="3">
								<div class="form-group">
									<div class="col-xs-12">
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="1" name="goods-style" id="cardStyle">卡片样式
										</label>
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="2" name="goods-style" id="simpleStyle"/>极简样式
										</label>
									</div>
								</div>
								<div class="divider"></div>
								<div class="form-group" ng-show="activeItem.params.sizeType == 1">
									<div class="col-xs-12">
										<label class="checkbox-inline"><!--极简样式不显示该项-->
											<input type="checkbox" ng-checked="activeItem.params.showBuyBtn == true"  ng-model="activeItem.params.showBuyBtn" />显示购买按钮
										</label>
									</div>
									<div class="col-xs-12" style="margin:10px 0 0 15px;" ng-show="activeItem.params.showBuyBtn == true">
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="1">样式1
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="2"/>样式2
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="3"/>样式3
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="4"/>样式4
										</label>
									</div>
								</div>
								<div class=" form-group">
									<div class="col-xs-12">
										<label class="checkbox-inline">
											<input type="checkbox" ng-model="activeItem.params.showTitle" />显示商品名(小图不显示商品名)
										</label>
									</div>
								</div>
								<div class="form-group">
									<div class="col-xs-12">
										<label class="checkbox-inline">
											<input type="checkbox" ng-model="activeItem.params.showPrice" />显示价格
										</label>
									</div>
								</div>
							</div>
							<!--大图设置-->
							<div class="card"  ng-switch-when="1">
								<div class="form-group" ng-show="activeItem.params.sizeType == 1">
									<div class="col-xs-12">
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="1" name="goods-style" id="cardStyle">卡片样式
										</label>
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="2" name="goods-style" id="simpleStyle"/>极简样式
										</label>
									</div>
								</div>
								<div class="divider"></div>
								<div class="form-group" ng-show="activeItem.params.sizeType == 1">
									<div class="col-xs-12">
										<label class="checkbox-inline"><!--极简样式不显示该项-->
											<input type="checkbox" ng-model="activeItem.params.showBuyBtn" />显示购买按钮
										</label>
									</div>
									<div class="col-xs-12" style="margin:10px 0 0 15px;" ng-show="activeItem.params.showBuyBtn == true">
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="1">样式1
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="2"/>样式2
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="3"/>样式3
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="4"/>样式4
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="5"/>样式5
										</label>
									</div>
								</div>
								<div class=" form-group">
									<div class="col-xs-12">
										<label class="checkbox-inline">
											<input type="checkbox" ng-model="activeItem.params.showTitle" />显示商品名
										</label>
									</div>
								</div>
								<div class=" form-group">
									<div class="col-xs-12">
										<label class="checkbox-inline">
											<input type="checkbox" ng-model="activeItem.params.showDesc" />显示商品简介
										</label>
									</div>
								</div>
								<div class="form-group">
									<div class="col-xs-12">
										<label class="checkbox-inline">
											<input type="checkbox" ng-model="activeItem.params.showPrice" />显示价格
										</label>
									</div>
								</div>
							</div>
							<!--小图设置-->
							<div class="card"  ng-switch-when="2">
								<div class="form-group">
									<div class="col-xs-12">
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="1" name="goods-style">卡片样式
										</label>
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="3" name="goods-style"/>瀑布流
										</label>
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="2" name="goods-style"/>极简样式
										</label>
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="4" name="goods-style"/>促销
										</label>
									</div>
								</div>
								<div class="divider"></div>
								<!--小图卡片样式,瀑布流样式-->
								<div class="form-group" ng-show="activeItem.params.sizeType == 1 || activeItem.params.sizeType == 3">
									<div class="col-xs-12">
										<label class="checkbox-inline"><!--极简样式不显示该项-->
											<input type="checkbox" ng-model="activeItem.params.showBuyBtn" />显示购买按钮
										</label>
									</div>
									<div class="col-xs-12" style="margin:10px 0 0 15px;" ng-show="activeItem.params.showBuyBtn == true">
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="1">样式1
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="2"/>样式2
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="3"/>样式3
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="4"/>样式4
										</label>
										
									</div>
								</div>

								<div class=" form-group" ng-show="activeItem.params.sizeType == 1 || activeItem.params.sizeType == 3">
									<div class="col-xs-12">
										<label class="checkbox-inline">
											<input type="checkbox" ng-model="activeItem.params.showTitle" />显示商品名
										</label>
									</div>
								</div>
								<div class="form-group" ng-show="activeItem.params.sizeType != 4">
									<div class="col-xs-12">
										<label class="checkbox-inline">
											<input type="checkbox" ng-model="activeItem.params.showPrice" />显示价格
										</label>
									</div>
								</div>
								<!--小图促销样式  无-->
							</div>
							<!--详细列表样式-->
							<div class="card"  ng-switch-when="4">
								<div class="form-group">
									<div class="col-xs-12">
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="1">卡片样式
										</label>
										<label class="radio-inline">
											<input type="radio" ng-model="activeItem.params.sizeType" value="2"/>极简样式
										</label>
									</div>
								</div>
								<div class="divider"></div>
								<div class="form-group" ng-show="activeItem.params.sizeType == 1 || activeItem.params.sizeType == 2">
									<div class="col-xs-12">
										<label class="checkbox-inline"><!--极简样式不显示该项-->
											<input type="checkbox" ng-model="activeItem.params.showBuyBtn" />显示购买按钮
										</label>
									</div>
									<div class="col-xs-12" style="margin:10px 0 0 15px;" ng-show="activeItem.params.showBuyBtn == true">
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="1">样式1
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="2"/>样式2
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="3"/>样式3
										</label>
										<label class="radio-inline">
											<input type="radio" name="btn-style" ng-model="activeItem.params.showBuyBtnStyle" value="4"/>样式4
										</label>
										
									</div>
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<!--end 商品设置-->

<div id="modal-search-goods" class="modal fade in" role="dialog" aria-hidden="false">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h3>选择商品</h3>
			</div>
			<div class="modal-body">
				<table class="table table-hover">
						<thead class="navbar-inner">
							<tr>
								<th style="width:40%;">标题</th>
								<th style="width:30%">创建时间</th>
								<th style="width:30%; text-align:right">
									<div class="input-group input-group-sm hidden">
										<input type="text" class="form-control">
										<span class="input-group-btn">
											<button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
										</span>
									</div>
								</th>
							</tr>
						</thead>
						<tbody>
							<tr ng-repeat="g in activeItem.params.searchGoodsList">
								<td><a href="#">{{g.title}}</a></td>
								<td>{{g.createtime}}</td>
								<td class="text-right">
									<a class="btn btn-default btn-sm" onclick="$(this).toggleClass('btn-primary')" data="{{g}}">选取</a>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="modal-footer">
					<div id="pager" style="float: left; margin:0"></div>
					<button style="float: right;" type="button" class="btn btn-primary">确认</button>
				</div>
			</div>
		</div>
	</div>
</div>
{else}
<!--app商品-->
<div class="app-goods">
	<div class="inner" ng-switch="module.params.listStyle" ng-class="{'js-default-content' : module.params.hasTestData == 1}">
		<!--卡片:goods-card,极简:goods-simple,促销:goods-sale;
			大图:lg   小图:sm  详细:detail
			购买按钮样式:btn1,btn2,btn3,btn4
		-->
	<!--一大两小样式-->
		<div class="defaultList" ng-switch-when="3">
			<ul class="goods-list clearfix">
				<li ng-class="{'col-xs-6 sm' : $index % 3 != 0, 'lg' : $index % 3 == 0, 'goods-simple' : module.params.sizeType == 2}" ng-repeat="g in module.params.goodsList">
						<div ng-class="{'goods-card':module.params.sizeType == 1}">
						<a href="./index.php?i={$_W['uniacid']}&c=entry&do=goods&ac=detail&m=lexiangpingou&id={{g.id}}">
							<div class="pic"><img src="" ng-src="{{g.thumb}}" /></div>
							<div class="goods-info">
								<p class="goods-title" ng-show="module.params.showTitle == true"><b>{{g.title}}</b></p>
								<p class="goods-sub-title c-black" ng-show="module.params.showDesc == true && module.params.listStyle == 1">{{g.desc}}</p>
								<p class="goods-price" ng-show="module.params.showPrice == true"><em>￥{{g.price}}</em></p>
							</div>
						</a>
						<div class="goods-buy js-buy-goods" goods-id="{{g.id}}" ng-show="module.params.showBuyBtn == true && module.params.sizeType == 1" ng-class="{1 : 'btn1', 2 : 'btn2', 3: 'btn3', 4 : 'btn4'}[module.params.showBuyBtnStyle]"></div>
					</div>
				</li>
			</ul>
		</div>
	<!--大图样式-->
		<div class="lgImg" ng-switch-when="1">
			<ul class="goods-list">
				<li class="lg" ng-repeat="g in module.params.goodsList">
					<div class="goods-card">
						<a href="./index.php?i={$_W['uniacid']}&c=entry&do=goods&ac=detail&m=lexiangpingou&id={{g.id}}">
							<div class="pic"><img src="" ng-src="{{g.thumb}}" /></div>
							<div class="goods-info">
								<p class="goods-title" ng-show="module.params.showTitle == true"><b>{{g.title}}</b></p>
								<p class="goods-sub-title c-black" ng-show="module.params.showDesc == true && module.params.listStyle == 1">{{g.desc}}</p>
								<p class="goods-price" ng-show="module.params.showPrice == true"><em>￥{{g.price}}</em></p>
							</div>
						</a>
						<div class="goods-buy js-buy-goods" goods-id="{{g.id}}" ng-show="module.params.showBuyBtn == true && module.params.sizeType == 1" ng-class="{1 : 'btn1', 2 : 'btn2', 3: 'btn3', 4 : 'btn4',5 : 'btn5'}[module.params.showBuyBtnStyle]"></div>
					</div>
				</li>
			</ul>
		</div>
	<!--小图样式-->
		<div class="smImg" ng-switch-when="2">
			<div ng-switch="module.params.sizeType">
				<ul class="goods-list clearfix" ng-switch-when="1">
					<!--卡片样式-->
					<li class="col-xs-6" ng-repeat="g in module.params.goodsList">
						<div class="goods-card sm ">
							<a href="./index.php?i={$_W['uniacid']}&c=entry&do=goods&ac=detail&m=lexiangpingou&id={{g.id}}">
								<div class="pic"><img src="" ng-src="{{g.thumb}}" /></div>
								<div class="goods-info">
									<p class="goods-title" ng-show="module.params.showTitle == true"><b>{{g.title}}</b></p>
									<p class="goods-price" ng-show="module.params.showPrice == true"><em>￥{{g.price}}</em></p>
								</div>
							</a>
							<div class="goods-buy js-buy-goods" goods-id="{{g.id}}" ng-show="module.params.showBuyBtn == true && (module.params.sizeType == 1 || module.params.sizeType == 3)" ng-class="{1 : 'btn1', 2 : 'btn2', 3: 'btn3', 4 : 'btn4'}[module.params.showBuyBtnStyle]"></div>
							</a>
						</div>
					</li>
				</ul>
				<ul class="goods-list clearfix" ng-switch-when="2">
					<!--极简样式-->
					<li class="col-xs-6" ng-repeat="g in module.params.goodsList">
						<div class="goods-simple sm ">
							<a href="./index.php?i={$_W['uniacid']}&c=entry&do=goods&ac=detail&m=lexiangpingou&id={{g.id}}">
								<div class="pic"><img src="" ng-src="{{g.thumb}}" /></div>
								<div class="goods-info">
									<p class="goods-price" ng-show="module.params.showPrice == true"><em>￥{{g.price}}</em></p>
								</div>
							</a>
						</div>
					</li>
				</ul>
				<ul class="goods-list clearfix" ng-switch-when="4">
					<!--促销样式-->
					<li class="col-xs-6" ng-repeat="g in module.params.goodsList">
						<div class="goods-sale sm ">
							<div class="pic"><a href="./index.php?i={$_W['uniacid']}&c=entry&do=goods&ac=detail&m=lexiangpingou&id={{g.id}}"><img src="" ng-src="{{g.thumb}}" /></a></div>
							<div class="goods-info">
								<span class="goods-price pull-left" ng-show="module.params.showPrice == true">￥{{g.price}}</span>
								<span class="pull-right buy-btn"><a href="javascript:;" class="goods-buy js-buy-goods" goods-id="{{g.id}}"> 我要抢购</a></span>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	<!--详细列表样式-->
		<div class="detailList" ng-switch-when="4">
			<div ng-switch="module.params.sizeType">
				<ul class="goods-list clearfix" ng-switch-when="1">
					<li class="goods-card" ng-repeat="g in module.params.goodsList">
						<a href="./index.php?i={$_W['uniacid']}&c=entry&do=goods&ac=detail&m=lexiangpingou&id={{g.id}}">
						<div class="pic col-xs-6"><img src="" ng-src="{{g.thumb}}" /></div>
						<div class="col-xs-6">
							<div class="goods-info">
								<p class="goods-title"><b>{{g.title}}</b></p>
								<p class="goods-price"><em>￥{{g.price}}</em></p>
							</div>
						</div>
						</a>
						<div class="goods-buy js-buy-goods" goods-id="{{g.id}}" ng-show="module.params.showBuyBtn == true" ng-class="{1 : 'btn1', 2 : 'btn2', 3: 'btn3', 4 : 'btn4'}[module.params.showBuyBtnStyle]"></div>
					</li>
				</ul>
				<ul class="goods-list clearfix" ng-switch-when="2">
					<li class="goods-simple" ng-repeat="g in module.params.goodsList">
						<a href="./index.php?i={$_W['uniacid']}&c=entry&do=goods&ac=detail&m=lexiangpingou&id={{g.id}}">
						<div class="pic col-xs-6"><img src="" ng-src="{{g.thumb}}" /></div>
						<div class="col-xs-6">
							<div class="goods-info">
								<p class="goods-title"><b>{{g.title}}</b></p>
								<p class="goods-price"><em>￥{{g.price}}</em></p>
							</div>
						</div>
						</a>
						<div class="goods-buy js-buy-goods" goods-id="{{g.id}}" ng-show="module.params.showBuyBtn == true" ng-class="{1 : 'btn1', 2 : 'btn2', 3: 'btn3', 4 : 'btn4'}[module.params.showBuyBtnStyle]"></div>
					</li>
				</ul>
			</div>
		</div>
	</div>
</div>
<!--end商品-->
{/if}
</div>